<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<base href="<%=basePath %>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<!-- BOOTSTRAP STYLES-->
<link href="css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="css/font-awesome.css" rel="stylesheet" />
<!--CUSTOM BASIC STYLES-->
<link href="css/basic.css" rel="stylesheet" />
<!--CUSTOM MAIN STYLES-->
<link href="css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href='http://fonts.useso.com/css?family=Open+Sans'
	rel='stylesheet' type='text/css' />
<title>菜单管理</title>
<script type="text/javascript">
function msearch(){
	var DishName = $("#dish").val();
	var MenuClassid=$("#MenuClassid option:selected").val();
	window.location.href="menu/searchmenu.do?DishName="+DishName+"&MenuClassid="+MenuClassid; 
}
function deletemenu(DishId){
	var cf=confirm("确定删除"+DishId+"号菜品？");
	if(!cf){
		return;
	}
	window.location.href="menu/deletemenu.do?DishId="+DishId;
}
</script>

<script src="http://code.jquery.com/jquery-1.11.0-beta1.js"></script>
   
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-md-12">
				<h1 class="page-header">
					菜单管理 
				</h1>
			</div>
		</div>
		<div class="row">
			<div class=" col-md-12 ">
				<!-- 商品列表--bootstrap高级表格使用 -->
				<div class="panel panel-default">
					<div class="panel-heading">菜单列表</div>
					<div class="panel-body">
						<!--table-responsive响应式表格，会自动添加滚动条-->
						<div class="">
						菜品类别：<select id="MenuClassid" name="Menuclassid">
								<option value="0">全部</option>
								<option value="1">饮品</option>
								<option value="2">西餐</option>
								<option value="3">中餐</option>
							</select> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						</div>
						<br/>

						<div>
							菜品名称：<input id="dish" name="DishName" type="text" placeholder="请输入查询的菜品名称"/>&nbsp;&nbsp;&nbsp;&nbsp;
							<a id="search" name="search"  class="btn btn-info" onclick="msearch()">查询</a>
							<a id="add" name="add" type="button" class="btn btn-info" href="menujsp/AddMenu.jsp">添加</a>
						</div>
						<br/>
						<div class="table-responsive">
							<table class="table table-striped table-bordered table-hover"
								id="MenuManage">
								<thead>
									<tr>					
                                        <th>菜品编号</th> 
										<th>菜品名称</th>
										<th>菜品类型</th>
										<th>菜品图片</th>
										<th>菜品价格</th>
										<th>菜品状态</th>
										<th>菜品描述</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${manmenulist}" var="mml">
										<tr>
											<td>${mml.dishId}</td>
											<td>${mml.dishName}</td>
											<td>${mml.menuClassname}</td>
											<td><img alt="图片加载中.." src="upimg/${mml.dishPicture }" style="width:60px;height:50px"></td>
											<td>￥：${mml.dishPrice}元/份</td>
											<td>${mml.dishState}</td>
											<td>${mml.dishDescribe }</td>
											<td><a title="修改" class="t-edit glyphicon glyphicon-pencil" href="menu/showmenu.do?DishId=${mml.dishId}"></a> &nbsp
												<a title="删除" class="t-del glyphicon glyphicon-trash" onclick="deletemenu(${mml.dishId})"></a></td>
										</tr>
									</c:forEach>
							</table>
						</div>

						<!--	<div class="container">-->
						<!--分页显示-->
					
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>